<template>
    <div class="common-layout">
        <div class="left-panel">
            <Tree @treeSelect="handleSelected" />
        </div>

        <div class="right-panel">
            <Chat class="chat" :chatValue="chatValue" :condition="true" />
        </div>
    </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import Tree from '@/components/tree.vue'
import Chat from '@/components/chat.vue'

const chatValue = ref('')

const handleSelected = (selectedData: any) => {
    chatValue.value = selectedData
    console.log("🚀 ~ handleSelected ~ chatValue.value:", chatValue.value)
}
</script>

<style lang="less" scoped>
/* 布局容器 */
.common-layout {
    display: flex;
    height: 100%;
}

/* 左侧面板 */
.left-panel {
    background-color: #F9FBFF;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s;
    padding: 20px;
    flex: 0.22;
    min-width: 0;
    /* mr-5 ≈ 20px */
}

// .left-panel:hover {
//     box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.15);
// }

/* 右侧面板 */
.right-panel {
    padding-top: 24px;
    /* pt-6 ≈ 24px */
    margin-left: 70px;
    flex: 0.72;
    min-width: 0;
}

/* 深度样式 */
:deep(.filter-tree) {
    height: 100%;
    background-color: #F9FBFF;
}
</style>